//初始化获取
const state = {
  token: '',
  user: {}
}
const getters = {
  //获取用户token
  getToken(state: any) {
    return state.token
  },

  //获取用户信息
  getUserInfo(state: any) {
    return state.user
  }
}
//设置token
const mutations = {
  // 设置用户的Token
  setToken(state: { token: string; }, token: string) {
    console.log('info---', token);
    state.token = token;
  },

  //设置用户的信息
  setUserInfo(state: { user: any }, user: any) {
    state.user = user
  }

}
const actions = {

}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}